Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use as const in TypeScript generator #357

Merged
merged 1 commit into from
Nov 1, 2024
Merged

Conversation

lynn
Copy link
Contributor

@lynn lynn commented Nov 1, 2024

It looks like discriminator = 3 as const lets tsc make somewhat more correct type inferences than discriminator: number = 3 as 3.

It looks like `discriminator = 3 as const` lets tsc make somewhat more correct type inferences than `discriminator: number = 3 as 3`.
@andrewmd5
Copy link
Contributor

LGTM. Thanks - let me know if you want me to push a new release that uses this.

@andrewmd5 andrewmd5 merged commit 99eb972 into betwixt-labs:master Nov 1, 2024
8 checks passed
@lynn
Copy link
Contributor Author

lynn commented Nov 1, 2024

Thanks! It matters a little less than I originally thought; I should have just been using the Enum.fromBranch() API instead of making my own { discriminator: Branch.discriminator } objects. So I'm doing that now, and I'm not blocked on having this in a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants